package day03;

import java.util.Scanner;

//此类是用于验证if...else...双分支的测试demo
public class if_v2 {
    public static void main(String[] args) {
        //需求：计算用户实际消费金额
        //用户消费金额大于等于500，则打8折
        //如果不满500，则打9折
        Scanner Price = new Scanner(System.in);
        System.out.println("用户应支付原价为：");
        double price=Price.nextDouble();
        char discount;
        if(price>=500){
            discount='八';
            price*=0.8;  //打八折
        }else{
            discount='九';
            price*=0.9;  //打九折
        }
        System.out.println("打"+discount+"折，用户实际消费金额为："+price);
    }
}
